import java.util.*;
public class Practice3 {
    public static void main(String[] args) {
        //https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b        
        //先排序, 然后每次去掉最大的和最小的元素, 拿到最大的元素的后一个元素
        //并重复这样做
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n * 3];
        for (int i = 0; i < n * 3; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        int left = 0;
        int right = n * 3 - 1;
        long sum = 0;//防止溢出(我开始就忘记了)
        while(right > left){
            right -= 2;
            left++;
            sum += arr[right + 1];
        }
        System.out.println(sum);
    }
}
